package com.pro.controller;

import com.pro.entry.JsUserCollection;
import com.pro.service.JsUserCollectionService;
import com.pro.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName:JsUserCollectionController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2022/4/13 9:37
 * @Author: ZPT
 */
@RestController
@RequestMapping("/collection")
public class JsUserCollectionController {

    @Autowired
    private JsUserCollectionService collectionService;

    /**
     * @author ZPT
     * @content :添加收藏记录
     */
    @PostMapping("/addCollection")
    public JsonData addCollection(JsUserCollection userCollection){
        Boolean addCollection = collectionService.addCollection(userCollection);
        return addCollection?JsonData.buildSuccess(userCollection):JsonData.buildError("服务端错误");
    }
}
